function login(){
    var username = document.getElementById("ID").value;
    var password = document.getElementById("PASSWORD").value;
    if(username==""){
        $.jGrowl("用户名不能为空！", { header: '提醒' });
    }else if(password==""){
        $.jGrowl("密码不能为空！", { header: '提醒' });
    }else{

    	$("#load").show();
        $("#loads").show();
    	AjaxFunc();
    }
	
	
	
	
}

/*$('#PASSWORD').bind('keypress', function(event) {
    if (event.keyCode == "13") {
        event.preventDefault();
        //回车执行查询
        $('#LOGIN').click();
    }
});*/

function AjaxFunc()
{
    var username = document.getElementById("ID").value;
    username = username.replace(/\s+/g,"");
    var password = document.getElementById("PASSWORD").value;
    $.ajax({
		async:true,
		type:"POST",
		url:"../userAction/findManager",
		data:{
			'userAccount' : username,
			'userPassword' : password
		},
		success:function(msg){
			if(msg.num == 0){
				$.jGrowl("登录成功", { header: '提醒' });
				location.href = "main.html";

			}else{
                $("#load").hide();
                $("#loads").hide();
				$.jGrowl(msg.msg, { header: '提醒' });
			}
		}
	},"json");
   
}